package cn.yujiago.shiro.controller;

import cn.yujiago.shiro.domain.DeptDO;
import cn.yujiago.shiro.pojo.LayuiTreeNode;
import cn.yujiago.shiro.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/dept/tree")
    @ResponseBody
    public List<LayuiTreeNode<DeptDO>> deptTree(){
        return departmentService.getDepartmentTree();
    }

}
